Imports Security.Business

Partial Class Shared_LoginStatus
    Inherits System.Web.UI.UserControl

    Protected Sub lnkLogOut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkLogOut.Click
        Security.Business.LoginService.Logout()
        Response.Redirect("~/FrontEnd/Default.aspx")
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If LoginService.IsLoggedIn() Then
            LoggedInPanel.Visible = True
            LoggedOutPanel.Visible = False
            lblUserName.Text = LoginService.UserSession.UserName
        Else
            LoggedInPanel.Visible = False
            LoggedOutPanel.Visible = True
        End If
    End Sub
End Class
